<template>
    <card class="result">
        <img :src="imgSrc"/>
        <p class="xiangsidu" v-if="xiangsidu">相似度：{{xiangsidu}}</p>
        <p class="xiangsidu" v-else></p>
        <p class="time">{{localTime}}</p>
        <p class="location">{{location}}</p>
    </card>
</template>

<script>

    import TimeUtils from "@/libs/time"
    import Card from "iview/src/components/card/card";

    export default {
        components: {Card},
        name: "serach-result",
        props: {
            xiangsidu: String,
            time: String,
            location: String,
            imgSrc:String
        },
        data() {
            return {}
        },
        computed: {
            localTime: function () {
                console.log(this.time)
                if(this.time){
                    return TimeUtils.convertStr(this.time, 'yyyyMMddHHmmss','yyyy-MM-dd HH:mm')
                }
            }
        }
    }
</script>

<style scoped>
    .result {
        /*margin: 10px 20px 10px 20px;*/
        margin: 0px 5px 0px 5px;
        align-content: center;
    }

    .result img {
        width: 110px;
        height: 110px;
        border-radius: 5%;
    }

    .xiangsidu {
        color: #ff0000;
        font-size: 18px;
    }

    .time {
        font-size: 14px;
    }

    .location {
        font-size: 14px;
    }

</style>